Popover: Include window shadows in overshoot calcs
authorDaniel Boles <dboles@src.gnome.org>
Wed, 23 Aug 2017 20:44:10 +0000 (21:44 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Thu, 24 Aug 2017 19:57:01 +0000 (20:57 +0100)
commit947bca195cddd645e36eb5fa040bd6bc57bde395
tree486760da7f430ff0e7f2455a29700be9883cd237
parent3a2c379f3c891106cf4b6e587e41e93a5e15a59f
Popover: Include window shadows in overshoot calcs

.update_position() enforces that non-Wayland platforms must position a
Popover within its parent Window. We use the allocation of the Window
to translate the position and check for overshoot on each of its sides.
Calling Widget.get_allocation() of a CSD Window includes its shadows.

But shadows were not excluded from the area in which we can position.
Thus, Popovers could get positioned in the shadow of CSD windows, where,
at least on X11, no input is received. Therefore, positioning a Popover
over a shadow meant its child widgets within that area became unusable.

Fix by calling Window.get_shadow() and including it in the overshoot on
each side. This adjusts for how the allocation includes shadows, making
overshoots with and without shadows the same. Thus, we avoid considering
shadows as viable for positioning, favouring a side where input works.

https://bugzilla.gnome.org/show_bug.cgi?id=786209
gtk/gtkpopover.c